﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BiliBiliCSharpStudy.old {
    class ReadonlyDemo {
        public static void demo() {
            test1();
        }

        public static void test1() {
            Console.WriteLine(Brush1.DefaultColor.Red);
            Console.WriteLine(Brush1.DefaultColor.Green);
            Console.WriteLine(Brush1.DefaultColor.Blue);
            var person = new { Name = "小明", ID = 101 };
            Console.WriteLine(person.Name);
        }
    }

    struct Color1 {
        public int Red;
        public int Green;
        public int Blue;
    }

    class Brush1 {
        public static readonly Color1 DefaultColor = new Color1() { Red = 0, Green = 0, Blue = 0 };
    }

    class Brush2 {
        public static readonly Color1 DefaultColor;
        static Brush2() {
            Brush2.DefaultColor = new Color1() { Red = 0, Green = 0, Blue = 0 };
        }
    }
}
